window.performanceAPI = {
    // 获取绩效记录列表
    getPerformances: async (params = {}) => {
        try {
            const response = await apiClient.get('/api/performances/', { params });
            return response;
        } catch (error) {
            console.error('获取绩效记录失败:', error);
            throw error;
        }
    },

    // 创建绩效记录
    createPerformance: async (performanceData) => {
        try {
            const response = await apiClient.post('/api/performances/', performanceData);
            return response;
        } catch (error) {
            console.error('创建绩效记录失败:', error);
            throw error;
        }
    },

    // 更新绩效记录
    updatePerformance: async (id, performanceData) => {
        try {
            const response = await apiClient.put(`/api/performances/${id}`, performanceData);
            return response;
        } catch (error) {
            console.error('更新绩效记录失败:', error);
            throw error;
        }
    },

    // 删除绩效记录
    deletePerformance: async (id) => {
        try {
            const response = await apiClient.delete(`/api/performances/${id}`);
            return response;
        } catch (error) {
            console.error('删除绩效记录失败:', error);
            throw error;
        }
    },

    // 获取年度绩效趋势
    getYearlyTrend: async () => {
        try {
            const response = await apiClient.get('/api/performances/yearly-trend');
            return response;
        } catch (error) {
            console.error('获取年度绩效趋势失败:', error);
            throw error;
        }
    }

};
